package com.sl.mes.db.service.bd;

import com.sl.mes.db.dao.BdDefdoclistMapper;
import com.sl.mes.db.itf.bd.IBdDefdoclist;
import com.sl.mes.db.vo.*;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BdDefdoclistService implements IBdDefdoclist {
    BdDefdoclist.Column[] columns = new BdDefdoclist.Column[] {
            BdDefdoclist.Column.pkDefdoclist, BdDefdoclist.Column.code,BdDefdoclist.Column.name};
    @Resource
    private BdDefdoclistMapper bdDefdoclistMapper;

    @Override
    public BdDefdoclist findByCode(String code) {
        BdDefdoclistExample example=new BdDefdoclistExample();
        //example.or().andIdIn(Arrays.asList(pk_psndoc)).andEnabledEqualTo(true).andDeletedEqualTo(false);
        example.or().andCodeEqualTo(code).andDrEqualTo(0);

        BdDefdoclist bdDefdoclist = bdDefdoclistMapper.selectOneByExampleSelective(example, columns);

        return bdDefdoclist;
    }
}
